home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-22 | 1.2 KB | 47 lines |
- import vs.*;
- import vrml.*;
-
- public class shareclick extends Script {
-
- SFNode sharedObjNode = (SFNode)getField("sharedobj");
- Transform sharedObj = (Transform)sharedObjNode.getValue();
-
- public shareclick () {}
-
- public void touched (ConstSFBool flag, ConstSFTime time) {
-
- if(flag.getValue() == true)
- return;
-
- if(Vscp.amIMaster()) {
-
- Vscp.sendApplSpecificMsgWithDist(sharedObjNode, "rpc_rotateBox",
- "", Vscp.allClientsExceptMe);
- actualChangeBox();
- }
- else {
- Vscp.sendApplSpecificMsgWithDist(sharedObjNode, "rpc_touched", "",
- Vscp.responderOnly);
- }
- }
-
- public void rpc_touched(ConstSFString dum1, ConstSFTime dum2) {
-
- Vscp.sendApplSpecificMsgWithDist(sharedObjNode, "rpc_rotateBox",
- "", Vscp.allClientsExceptMe);
- actualChangeBox();
- }
-
- public void rpc_rotateBox(ConstSFString data, ConstSFTime time) {
- actualChangeBox();
- }
-
- public void actualChangeBox() {
- float [] axis = {0, 1, 0, 10};
- float [] center = {0, 0, 0};
-
- sharedObj.rotateAroundLineDegree(axis, center, sharedObj.modeRelative);
- }
- }
-
-